package com.object;

public enum PKT_Status {
    H80("传送成功"),
    H01("序号错误"),
    H02("接收的数据量不对"),
    H03("接收超时"),
    Hxx("未知状态码");

    private final String info;
    private PKT_Status(String info){
        this.info = info;
    }

    public static PKT_Status checkStatus(byte statusCode){
        switch (statusCode){
            case (byte)0x80:
                return H80;
            case (byte)0x01:
                return H01;
            case (byte)0x02:
                return H02;
            case (byte)0x03:
                return H03;
            default:
                return Hxx;
        }
    }
    public String getStatusInfo(){
        return this.info;
    }
}
